/*** This file describes the raw claims data and the Stata do files that produce the results published in �Insurers� Negotiating Leverage and the External Effects of Medicare Part D.� The readme file has three sections:
	I. A description of the main analytic file and how it was constructed
	II. A data disctionary of variables used in the regressions and figures
	III. An outline of the accompanying Stata do files that produce the regression results and tables reported in the article


I. Analytic file:
The main analytic file is claims_enrollment_merged_nation.dta. This dataset is based on proprietary transaction-level claims data provided by a national retailer pharmacy. The key transaction-level claims data variables were date filled, NDC of drug, therapeutic code, pill count, patient out of pocket price, reimbursement paid by the insurer and the total reimbursement received by the pharmacy (equal to the OOP price paid plus the reimbursement paid by the insurer). Transaction-level claims data were collapsed down to the insurer-NDC level. Data from other sources, such as publicly available Part D plan, premium and enrollment data, were merged into the claims-based data at the insurer level, to form the main analytic file, to form this main analytic file. 

Key prescription drug claims-based variables contained in the analytic file, such as the average price of drugs at the insurer-NDC level, were calculated over five time periods: the second half of 2004 (local macro `Y� = 44), the second half of 2005 (`Y� = 54), first half of 2006 (`Y� = 63), the second half of 2006 (`Y� = 64) and the first 4 months of 2007 (`Y� = 7). These variables then allow for the calculation of changes in these claims based variables at the insurer-NDC level. For example, rm_pill_ndc_firm62 is the average price per pill at the insurer-NDC level over the transaction first half of 2006, and c_rm_pill_ndc_firm6254 is the change in the average price per pill at the insurer-NDC level, where prices per pill were averaged over the first half of 2006 and compared against the average price over second half of 2005 (other first difference variables follow local macro `X� = 5444 (difference between first half 2005 and second half of 2004), 6254 (difference between first half 2006 and second half of 2005), 6454 (difference between second half 2006 and second half of 2005), 754 (difference between first four months of 2006 and second half of 2005).     

In calculating averages over half year periods at the insurer-NDC level, weights were used based on the total number of claims at the insurer-NDC level over that period. Other prescription drug claims-based variables were calculated in a similar way.

II. Data dictionary for the main analytic file:
parent_organization:		Insurer name
parent_organization_id: 		Insurer ID number
humana: 				Binary variable indicating insurer is Humana
nbr_ndc: 				NDC code
nbr_ndc1-nbr_ndc$m: 		Indicator variables for each NDC
rank: 				Simple rank across NDC by expenditures, based on Rx claims  

rm_pill_ndc_firm`Y�: 		Price (total reimbursement to the pharmacy) per pill averaged over period `Y� at the NDC-insurer level
c_rm_pill_ndc_firm`X�: 		Change in the price per pill between periods two periods
qty100_rx_ndc_firm`Y': 		Average number of pills per prescription at the NDC-insurer level over period Y
c_qty100_rx_ndc_firm`X': 		Change in the average number of pills per prescription between two periods
share_exposure_WG`Y': 		Fraction of retail pharmacy market held by the pharmacy in areas where each insurer is present (a measure of the retailers market power)
cl_share_exposure_WG`X': 		Change a measure of the retailers market power)
adj_awp_pill_ndc`Y�: 		Average wholesale price of a drug over the first half of 2006, as reported by the pharmacy
c_adj_awp_pill_ndc`X�: 		Average wholesale price of a drug over the first half of 2006, as reported by the pharmacy
ndc_firm_ind_wt6254: 		NDC-insurer level weight, equal to the number of prescriptions at the insurer-NDC level between the second half of 2005 and the first half of 2006
branded: 				Binary variable indicating the NDC is a branded drug
generic: 				Binary variable indicating the NDC is a generic drug

enrollment_total_1m_2006: 		Part D enrollment in plans of a given insurer (in millions)
enrollment_total_1m_2006_2: 	Square of enrollment_total_1m_2006
noseniors_firm_noprivhi_06M: 	No. of seniors who don't have private Rx coverage in 2004 and 2005 within the states where the insurer is present in the commercial market--an insurer level variable, derived from the CPS.
noseniors_firm_noprivhi_06M_2: 	Square of noseniors_firm_noprivhi_06M
adjfe_log: 			Insurer fixed effect from a regression of 2006 PDP plan premiums on plan design and the average retail price of drugs paid to the pharmacy (a measure of insurer cost), controlling for PDP region, and restricting the sample of PDPs to basic plans. Given the comparability across plans, the insurer FE captures insurer-specific differences in cost structure and pricing strategy in the PDP market.
adjfe_log2: 			Square of adjfe_log 



III. Stata Do files:
1. Regressions_restat.do: produces all regression results reported in the paper (Tables 4, 5, 6, Appendix Table 1, 2, 3, 4, 5 and 6).

2. Quantify_spillovers.do: used the regression results and claims data to quantify a) the internal savings effect of Part D for seniors who became insured due to Part D, b) the external spillover effects of lower unit prices on the commercial population; and c) the savings to previously insured seniors who benefit from the lower unit price.

3. Figures_restat.do: produces the Rx claims-based figures (Figures 3a, 3b, 4, 5, 6a and 6b). 

All do files were run on Stata MP v11.2.
***/


